//
//  Person.h
//  RunLoopDemo
//
//  Created by zhangjikuan on 2020/8/27.
//  Copyright © 2020 hsgd. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

// atomic只是保证了getter和setter存取方法的线程安全,并不能保证整个对象是线程安全的,因此在多线程编程时,线程安全还需要开发者自己来处理.

//关于选择:atomic系统生成的getter、setter会保证get、set操作的安全性,但相对nonatomic来说,atomic要更耗费资源,且速度要慢,故在iPhone等小型设备上,如果没有多线程之间的通讯,使用nonatomic是更好的选择


/// 研究copy 和 strong的区别

@interface Person : NSObject
@property (nonatomic, assign) float height;
@property (nonatomic, assign) float weight;

@property (nonatomic, copy) NSString *idNumber;
@property (nonatomic, strong) NSString *name;

@property (nonatomic, strong) NSArray *interests;
@property (nonatomic, copy) NSArray *subjects;

@property (nonatomic, strong) NSDictionary *dic1;
@property (nonatomic, copy) NSDictionary *dic2;

@property (nonatomic, strong) NSMutableArray *muInterests;
@property (nonatomic, copy) NSMutableArray *musubjects;

@end

NS_ASSUME_NONNULL_END
